package com.hxzy.module.admin.api.role.resp;

import com.hxzy.module.admin.api.menu.resp.ModuleAuthorityResp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;

/**
 * @Author wy
 * @Description 角色权限树
 * @Date 2024/1/31 15:38
 * @Version 1.0
 */
@Getter
@Setter
@ApiModel(value = "角色权限树")
public class RoleAuthorityTreeResp {
    @ApiModelProperty("模块id")
    private Long moduleId;

    @ApiModelProperty("名称")
    private String name;

    @ApiModelProperty("标记")
    private Boolean mark;

    @ApiModelProperty("父ID")
    private Long pid;

    @ApiModelProperty("排序")
    private Integer sort;

    @ApiModelProperty("有值时设置选中的左侧路由，没有值时则为直接显示在左侧")
    private String activeMenu;

    @ApiModelProperty("路由url")
    private String showUrl;

    @ApiModelProperty("子模块")
    private List<RoleAuthorityTreeResp> sonModule;


    public RoleAuthorityTreeResp(){
    }

    public RoleAuthorityTreeResp(ModuleAuthorityResp  resp) {
        this.setModuleId(resp.getModuleId());
        this.setName(resp.getName());
        this.setMark(resp.getMark());
        this.setSort(resp.getSort());
        this.setActiveMenu(resp.getActiveMenu());
        this.setPid(resp.getPid());
        this.setShowUrl(resp.getShowUrl());
    }


}
